package com.lz.seata.domain;

import lombok.Data;

/**
 * @Description: CodeMsg
 * @Date: 2020/5/4 11:34
 * @Author: LiZhen
 * @Version: 1.0
 */
@Data
public class CodeMsg {
    public static CodeMsg SUCCESS = new CodeMsg(200, "服务器成功返回用户请求");
    public static CodeMsg SERVER_ERROR = new CodeMsg(500, "服务端异常");
    public static CodeMsg PRODUCT_SERVER_ERROR = new CodeMsg(500, "下单失败，目前库存充足，可能是product服务有问题");
    public static CodeMsg CREATED = new CodeMsg(201, "扣减库存成功");
    public static CodeMsg CREATED_ERROR = new CodeMsg(500, "扣减库存失败");
    public static CodeMsg NOT_FOUND = new CodeMsg(404, "发出的请求针对的是不存在的记录，服务器没有进行操作");
    public static CodeMsg Gone = new CodeMsg(401, "查询不到商品");

    private Integer code;
    private String msg;

    private CodeMsg(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}